//
// Created by rebeater on 7/20/21.
//

#include <iostream>
#include "Tree.h"

int main() {
  using element_type = char;
  vector<element_type> v{'a','b','c','d','e','f','g','h','i','j','k'};
  cout << "Initial Tree" << endl;
  for (auto &r:v) cout << r << '\t';
  cout << endl;
  BinaryTree<element_type> tree{v};/*建立完全二叉树*/
  vector<element_type> res;

  cout << "By Layer" << endl;
  res = tree.ToLayerOrder();
  for (auto &r:res) cout << r << '\t';
  cout << endl;

  cout << "By PreOrder" << endl;
  res = tree.ToPreOrder();
  for (auto &r:res) cout << r << '\t';
  cout << endl;

  cout << "By InOrder" << endl;
  res = tree.ToInOrder();
  for (auto &r:res) cout << r << '\t';
  cout << endl;
  cout << "By PostOrder" << endl;
  res = tree.ToPostOrder();
  for (auto &r:res) cout << r << '\t';
  cout << endl;

  cout<<"Depth:"<<tree.Depth();
  return 0;
}